package com.android.mymedicine.util;

import java.io.Serializable;
import java.util.List;

import com.android.mymedicine.domain.AbstractEntity;

public class ResponseData<T extends AbstractEntity> implements Serializable {

	private static final long serialVersionUID = 1L;

	private String message;

	private T item;

	private List<T> items;

	private ResponseDataStatus status = ResponseDataStatus.FAILED;

	public ResponseData() {

	}

	public ResponseData(String message, T item, List<T> items,
			ResponseDataStatus status) {
		super();
		this.message = message;
		this.item = item;
		this.items = items;
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public T getItem() {
		return item;
	}

	public void setItem(T item) {
		this.item = item;
	}

	public List<T> getItems() {
		return items;
	}

	public void setItems(List<T> items) {
		this.items = items;
	}

	public ResponseDataStatus getStatus() {
		return status;
	}

	public void setStatus(ResponseDataStatus status) {
		this.status = status;
	}

	public boolean wasSuccessful() {

		if (status == ResponseDataStatus.OK) {
			return true;
		} else {
			return false;
		}

	}

}